//
//  HTTPTOOL.h
//  MVC练习
//
//  Created by dllo on 15/9/22.
//  Copyright (c) 2015年 _ZHW. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking.h>

typedef NS_ENUM(NSUInteger, responseStyle) {
    DATA,
    JSON,
    XML
};

typedef NS_ENUM(NSUInteger, bodyStyle) {
    
    JSONStyle,
    stringStyle
};

@interface HTTPTOOL : NSObject
/**get请求方法
 *参数url:请求的网址
 *参数body:请求参数
 *参数success:请求成功时返回的数据
 *参数fail:请求失败时返回的错误信息
 */
+ (void)GETWithURL:(NSString *)url body:(NSDictionary *)body httpHead:(NSDictionary *)head responseStyle:(responseStyle)style success:(void(^)(id result))success fail:(void(^)(NSError *error))fail;

+ (void)POSTWithURL:(NSString *)url body:(id)body bodyStyle:(bodyStyle)bodyStyle httpHead:(NSDictionary *)head responseStyle:(responseStyle)style success:(void (^)(id result))success fail:(void (^)(NSError *error))fail;


@end
